#ifndef CHARACTERMODEL_H
#define CHARACTERMODEL_H


#include "d20models_global.h"
#include "D20BaseModel.h"
#include "D20CampaignModel.h"


#include <QPointer>


class D20MODELSSHARED_EXPORT D20CharacterModel : public D20BaseModel
{
    Q_OBJECT

public:

    enum Group
    {
        Group_FIRST = 0,

        HitDie = Group_FIRST, // usually d4, d6, d8, d10 and d12, but can depend on campaign...
        SkillPoints,    // depends on campaign skill point categories
        ClassSkills,    // depends on campaing skills
        SavingThrows,   // usually For, Ref, Will, but there can be more according to campaign...
        BaseBonuses,    // usually BA, but there can be more according to campaign...
        SpecialAbilities, // depends on campaign specials. talents (Modern D20) can be inserted here...

        Group_LAST = SpecialAbilities
    };


    D20CharacterModel(QObject *parent = 0);

    void setCampaignModel(D20CampaignModel* campaign);

    virtual QVariant data(const QModelIndex &index, int role) const;
    virtual bool setData(const QModelIndex &index, const QVariant &value, int role);

    virtual Qt::ItemFlags flags(const QModelIndex &index) const;

    virtual QVariantMap options(const QString& groupName, const QString& itemName) const;

protected:

    QPointer<D20CampaignModel> m_campaignModel;

    void initializeGroup(const int& characterGroup, const QStringList& names);

    void validateCheckable(const int& characterGroup, const QStringList& names);
    void validateSelectable(const int& characterGroup, const int& campaignGroup);

};

#endif // CHARACTERMODEL_H
